Micron Document
NexusPi Git Node


Displaying Raw • Download

lib/microReticulum/src/Cryptography/Hashes.cpp copilot/add-rtnode-configuration-options (9529fa8a) Text, 898 B

Tff7b72#Tff7b72include T8b949e"Hashes.h"

Tff7b72#Tff7b72include T8b949e"../Bytes.h"

Tff7b72#Tff7b72include T8b949e<SHA256.h>
Tff7b72#Tff7b72include T8b949e<SHA512.h>

Tff7b72using Tff7b72namespace T7ee787RNSTb4b4b4;

T8b949e/*
The SHA primitives are abstracted here to allow platform-
aware hardware acceleration in the future. Currently only
uses Python's internal SHA-256 implementation. All SHA-256
calls in RNS end up here.
*/

Tff7b72const Te6edf3Bytes Td2a8ffRNS::Cryptography::sha256Tb4b4b4(Tff7b72const Te6edf3BytesTff7b72& Te6edf3dataTb4b4b4) Tb4b4b4{
T8b949e//TRACE("Cryptography::sha256: data: " + data.toHex() );
Te6edf3SHA256 Te6edf3digestTb4b4b4;
Te6edf3digestTb4b4b4.Te6edf3resetTb4b4b4(Tb4b4b4)Tb4b4b4;
Te6edf3digestTb4b4b4.Te6edf3updateTb4b4b4(Te6edf3dataTb4b4b4.Te6edf3dataTb4b4b4(Tb4b4b4)Tb4b4b4, Te6edf3dataTb4b4b4.Te6edf3sizeTb4b4b4(Tb4b4b4)Tb4b4b4)Tb4b4b4;
Te6edf3Bytes Te6edf3hashTb4b4b4;
Te6edf3digestTb4b4b4.Te6edf3finalizeTb4b4b4(Te6edf3hashTb4b4b4.Te6edf3writableTb4b4b4(T79c0ff32Tb4b4b4)Tb4b4b4, T79c0ff32Tb4b4b4)Tb4b4b4;
T8b949e//TRACE("Cryptography::sha256: hash: " + hash.toHex() );
Tff7b72return Te6edf3hashTb4b4b4;
Tb4b4b4}

Tff7b72const Te6edf3Bytes Td2a8ffRNS::Cryptography::sha512Tb4b4b4(Tff7b72const Te6edf3BytesTff7b72& Te6edf3dataTb4b4b4) Tb4b4b4{
Te6edf3SHA512 Te6edf3digestTb4b4b4;
Te6edf3digestTb4b4b4.Te6edf3resetTb4b4b4(Tb4b4b4)Tb4b4b4;
Te6edf3digestTb4b4b4.Te6edf3updateTb4b4b4(Te6edf3dataTb4b4b4.Te6edf3dataTb4b4b4(Tb4b4b4)Tb4b4b4, Te6edf3dataTb4b4b4.Te6edf3sizeTb4b4b4(Tb4b4b4)Tb4b4b4)Tb4b4b4;
Te6edf3Bytes Te6edf3hashTb4b4b4;
Te6edf3digestTb4b4b4.Te6edf3finalizeTb4b4b4(Te6edf3hashTb4b4b4.Te6edf3writableTb4b4b4(T79c0ff64Tb4b4b4)Tb4b4b4, T79c0ff64Tb4b4b4)Tb4b4b4;
T8b949e//TRACE("Cryptography::sha512: hash: " + hash.toHex() );
Tff7b72return Te6edf3hashTb4b4b4;
Tb4b4b4}

Served by rngit 1.4.2 - Generated in 0.02s